package com.zhan.drugStore.util;

@SuppressWarnings("serial")
public class ResponseBean<T> extends ResponseBase
{
	private T data = null;

	public T getData()
	{
		return data;
	}

	public void setData(T data)
	{
		this.data = data;
	}

	public ResponseBean<T> success(T data)
	{
		super.success();
		this.data = data;
		return this;
	}
	
	public ResponseBean<T> fail(int code, String message)
	{
		super.setCode(code);
		super.setMessage(message);
		return this;
	}
	
	@Override
	public String toString()
	{
		return String.format("%s, entity->%s", super.toString(), this.data);
	}
}
